package dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import DButil.DBConnection;

public class DeleteUser {
	
     public int Delete(int id) {
    	 int row=0;
    	 String sql="delete from users where id=?";
    	 Connection connection = DBConnection.getConnection();
    	 try {
			PreparedStatement pstm=connection.prepareStatement(sql);
			pstm.setInt(1, id);
			row=pstm.executeUpdate();
			
		} catch (SQLException e) {
		System.out.println("DeleteUser error,message is:"+e.getMessage());
		}
    	return row;
     }
}
